package org.zn.etl.service;

import java.util.List;

import org.zn.etl.datasource.entity.DataSourceInfo;
import org.zn.etl.job.entity.BatchJobGroupForm;
import org.zn.etl.job.entity.ColumnMappingForm;
import org.zn.etl.job.entity.EtlJob;
import org.zn.etl.job.entity.JobGroup;
import org.zn.etl.job.entity.po.DataSourceInfoPo;
import org.zn.etl.job.entity.po.EtlJobPo;
import org.zn.etl.job.entity.po.JobGroupPo;

public interface EtlPersistService {
	
	/**
	 * 添加修改的 任务信息
	 * @param job
	 * @return
	 */
	 EtlJobPo saveEtlJob(EtlJob job);
	 
	 /**
	* 删除
	* @param id
	* @param name
	* @return
	*/
	int delEtlJob(Long id,String name);
	
	/**
	 * 查询任务By Id
	 * @param id
	 * @return
	 */
	public EtlJob queryEtlJobById(Long id);
	 /**
	  * 查询任务
	  * @return
	  */
	 public EtlJob queryEtlJob(String jobName) ;
	 
	 /**
	  * 任务列表
	  * @param pageNum
	  * @param pageSize
	  * @return
	  */
	 public List<EtlJobPo>  queryEtlJobList(Integer pageNum, Integer pageSize);
	 
	 /**
	  *添加新的 数据源信息
	  * @param dsi
	  * @return
	  */
	 public DataSourceInfoPo addDataSourceInfo(DataSourceInfo dsi) ;
	
	 /**
	  * 修改 数据源信息
	  * @param dsi
	  * @return
	  */
	 int updateDataSourceInfo(DataSourceInfoPo dsi);
	/**
	 * 查询数据源
	 * @param dsi
	 * @return
	 */
	 public DataSourceInfoPo queryDataSourceByName(String name) ;
	 
	 /**
	 * 查询数据源列表
	* @param dsi
	* @return
	*/
	public  List<DataSourceInfoPo> dataSourceList(Integer pageNum,Integer pageSize) ;
	
	/**
	 * 添加任务组
	 * @param jg
	 * @return
	 */
	public JobGroupPo addJobGroup(JobGroup jg) ;
	/**
	 * 查询任务组
	 * @param jg
	 * @return
	 */
	public JobGroup queryJobGroupBy(String name);

	
	/**
	 * 批量添加任务 为 组
	 * @param jg
	 * @return
	 */
	public JobGroupPo batchAddJobForGroup(BatchJobGroupForm jg) ;
	
	/**
	 * 组列表
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	public List<JobGroupPo> jobGroupList(Integer pageNum, Integer pageSize);
	
	
	/**
	 * 添加字段映射
	 * @param form
	 * @return
	 */
	public int addDataMappingColumn(ColumnMappingForm form);
	
	/**
	 * 清空 关系映射字段
	 * @param dataMappingId
	 * @return
	 */
	public int clearColumnMappingByDmId(Long  dataMappingId);
	
	/**
	 * 按JobName 删除 字段映射
	 * @param jobName
	 * @return
	 */
	public int clearColumnMappingByJobName(String jobName);

}
